#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
typedef struct{
	int a[4][4];
}AD;
AD emt;
AD tms(AD A,AD B)
{
	AD res = emt;
	for(int i = 0;i < 4;i++)
		for(int j = 0;j < 4;j++)
			for(int k = 0;k < 4;k++)
				(res.a[i][j] += 1ll * A.a[k][j] * B.a[i][k] % mod) %= mod;
	return res;
}
AD qmi(AD a,int b)
{
	AD res = emt;
	for(int i = 0;i < 4;i++)
		res.a[i][i] = 1;
	while(b)
	{
		if(b & 1)
			res = tms(res,a);
		a = tms(a,a);
		b >>= 1;
	}
	return res;
}
AD res,z,t;
int n,m,x,y;
char c;
int f[2][1<<10|1][1<<5|1];
void Solve()
{
	f[0][0][0] = 1;
	for(int i = 1;i <= n;i++)
	{
		for(int S = 0;S < (1 << 2 * m);S++)
			for(int j = 0;j < (1 << m);j++)
				f[i & 1][S][j] = 0;
		for(int j = 0;j < (1 << m);j++) if(i != x || j == y)
			for(int S = 0;S < (1 << 2 * m);S++)
				for(int l = 0;l < (1 << m);l++)
					(f[i & 1][S ^ (l * j)][j] += f[(i & 1) ^ 1][S][l]) %= mod;
	}
	long long ans = 0;
	for(int S = 0;S < (1 << 2 * m);S++)
		for(int i = 0;i < (1 << m);i++)
			(ans += 1ll * S % (1 << m) * f[n & 1][S][i]) %= mod;
	cout << ans << "\n";
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("pearl.in","r",stdin);
	freopen("pearl.out","w",stdout);
	cin >> n >> m >> x;
	for(int i = 0;i < m;i++)
		cin >> c,y += (c - '0') << i;
	cerr << y << "\n";
	if(m != 1)
	{
		Solve();
		return 0;
	}
	res.a[0][0] = 1;
	for(int i = 0;i < 4;i++)
	{
		int op = i & 1;
		for(int j = 0;j < 2;j++)
		{
			int ad = (op & j);
			int to = ((i & 2) ^ (ad << 1)) | j;
			z.a[to][i]++;
		}
	}
	res = tms(res,qmi(z,x - 1));
	for(int i = 0;i < 4;i++)
	{
		int op = i & 1;
		int ad = (op & y);
		int to = ((i & 2) ^ (ad << 1)) | y;
		(t.a[to][0] += res.a[i][0]) %= mod;
	}
	res = t;
	res = tms(res,qmi(z,n - x));
	int ans = 0;
	for(int i = 2;i < 4;i++)
		ans += res.a[i][0];
	cout << ans % mod;
	return 0;
}